import React, { useState } from 'react';
const Index = () => {
    /* useState */
    const [obj,setObj] = useState({name:"lisi"})
    const [fn,setFn] =useState(()=>{
        return 1
    })
    const handleObj = ()=>{
        setObj({
            ...obj,
            name:"react"
        })
    }
    return (
        <div>
            <button onClick={handleObj}>{obj.name}</button>  
            <button onClick={()=>{setFn(4)}}>{fn}</button>  
        </div>
    );
}
export default Index;
